import 'package:json2dart_safe/json2dart.dart';

class ExchangeModel {
  String? createdAt;
  int? satisfyDays;
  String? satisfyEndTime;
  String? satisfyInfo;
  String? satisfyStartTime;
  int? satisfyType;

  ExchangeModel({
    this.createdAt,
    this.satisfyDays,
    this.satisfyEndTime,
    this.satisfyInfo,
    this.satisfyStartTime,
    this.satisfyType,
  });

  Map<String, dynamic> toJson() {
    return Map<String, dynamic>()
      ..put('createdAt', this.createdAt)
      ..put('satisfyDays', this.satisfyDays)
      ..put('satisfyEndTime', this.satisfyEndTime)
      ..put('satisfyInfo', this.satisfyInfo)
      ..put('satisfyStartTime', this.satisfyStartTime)
      ..put('satisfyType', this.satisfyType);
  }

  ExchangeModel.fromJson(Map<String, dynamic> json) {
    this.createdAt = json.asString('createdAt');
    this.satisfyDays = json.asInt('satisfyDays');
    this.satisfyEndTime = json.asString('satisfyEndTime');
    this.satisfyInfo = json.asString('satisfyInfo');
    this.satisfyStartTime = json.asString('satisfyStartTime');
    this.satisfyType = json.asInt('satisfyType');
  }

  static ExchangeModel toBean(Map<String, dynamic> json) =>
      ExchangeModel.fromJson(json);
}
